<template>
	<view>
		<view class="bw-title">
			<text>{{object.title}}</text>
			<u-parse :content="object.content" @preview="preview" @navigate="navigate" v-if="object.content"></u-parse>
		</view>
	</view>
</template>

<script>
	import {pageList,pageDetail} from '../../../api/SinglePage.js';
	import uParse  from '../../../components/u-parse/u-parse.vue';
	export default {
		components:{
			uParse 
		},
		data() {
			return {
				req:{
					title:'', //标题
					identify:'', //标识
					limit:10,//每页数据条数
					page:1,//当前页面
				},
				object:{}
			}
		},
		async mounted() {
			const res = await pageList(this.req);
			const arr = res.data.data.filter(item => item.title == "关于我们")
			this.detail(arr[0].identify);
		},
		methods:{
			//查询关于我们详情
			async detail(e){
				const res = await pageDetail({identify:e});
				this.object = Object.assign(res.data);
			},
			navigate(e){
				console.log(e);
			},
			preview(){
				console.log(e);
			}
		}
	}
</script>

<style scoped lang="scss">
	@import url("@/components/u-parse/u-parse.css");  
	.bw-title {
		text-align: center;
		margin:30rpx auto;
		text {
			display: block;
		}
		image{
			width:200rpx;
			height:200rpx;
			margin-top:30rpx;
		}
	}
</style>
